<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 箭头函数 =>
      //Es5
      let fun = function (params) {
        return params;
      };
      //ES6箭头函数
      let fun2 = params => params;

      let sum = (num1, num2) => num1 + num2;
      // 如果返回的是一个对象，必须在对象外面加上括号
      let stu = () => ({
        id: 1,
        name: "jack",
      });

      // 1、this指向问题
      document.onclick = function () {
        setTimeout(() => {
          console.log(this.arguments); //不存在arguments对象
        }, 1000);
      };
    </script>
  </body>
</html>
